#!/bin/bash
# 查找并杀死占用指定端口的进程
PIDS=$(netstat -ntlp 2>/dev/null | grep :8090 | awk '{print $NF}' | awk -F"/" '{print $1}' | xargs)
if [ ! -z "$PIDS" ]; then
    echo "Killing processes: $PIDS"
    kill -9 $PIDS 2>/dev/null
else
    echo "No processes found on port 8092"
fi